<?php #Всплывающее окно

class modal_win extends Load_use
{
	private $printed=false;
	private $params_arr=array('width','height','title','cont','class','close_on');
	private $messages=false;
	
	function getBlock()
	{	
		if(!$this->printed)
		{
			$this->view->js('modal_win');
			$this->view->gText.='	<div class="global-popup _win_wrapper">

										<!-- global-popup__description Start -->
										<div class="global-popup__description _win_block">

											<!-- popup__close Start -->
											<span class="global-popup__close _win_close">
												<span>Закрыть</span>
											</span>
											<!-- popup__close end -->

											<!-- big-title Start -->
											<h2 class="big-title _win_title"></h2>
											<!-- big-title end -->
										<div class="_win_content"></div>

										</div>
										<!-- global-popup__description end -->	

										<!-- global-popup__popup-overlay Start -->
										<div class="global-popup__popup-overlay">&nbsp;</div>
										<!-- global-popup__popup-overlay end -->

									</div>';
			$this->printed=true;			
		}
		if(!empty($this->params))/*просто объявление */
		{			
			$btn=$this->getParam('btn',false);
			if($btn)$btn='\''.$btn.'\'';		
			$data=array();

			foreach($this->params_arr as $val)
			{
				if(isset($this->params[$val]))
					$data[$val=='class'?'t_class':$val]=$this->params[$val];
			}
			$init_id=$this->getParam('init_id',false);
			$data=getJSArr($data);
			$this->view->js_on_load[]=$init_id?'dee_modal_win.init('.$data.',\''.$init_id.'\')':' $('.$btn.').modal_win('.$data.','.($btn?'false':'true').'); ';
		}
	}
}